using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
namespace Ascent.Module.BusinessObjects.Base
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("基础数据")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("运输方式")]
  public partial class ShipVia : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private Ascent.Module.BusinessObjects.Purchase.PurchasingOrder _purchasingOrder;
    private System.String _remarks;
    private System.String _shipViaName;
    public ShipVia(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("运输方式")]
    public System.String ShipViaName
    {
      get
      {
        return _shipViaName;
      }
      set
      {
        SetPropertyValue("ShipViaName", ref _shipViaName, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remarks
    {
      get
      {
        return _remarks;
      }
      set
      {
        SetPropertyValue("Remarks", ref _remarks, value);
      }
    }
    public Ascent.Module.BusinessObjects.Purchase.PurchasingOrder PurchasingOrder
    {
      get
      {
        return _purchasingOrder;
      }
      set
      {
        if (_purchasingOrder == value)
          return;
        Ascent.Module.BusinessObjects.Purchase.PurchasingOrder prevPurchasingOrder = _purchasingOrder;
        _purchasingOrder = value;
        if (IsLoading)
          return;
        if (prevPurchasingOrder != null && prevPurchasingOrder.ShipVia == this)
          prevPurchasingOrder.ShipVia = null;
        if (_purchasingOrder != null)
          _purchasingOrder.ShipVia = this;
        OnChanged("PurchasingOrder");
      }
    }
  }
}
